//
// Created by PC on 2024/4/24.
//


#include <iostream>
#include<vector>

using namespace std;

int main()
{
    int n = 100;
    n = 1000; //168
//    n = 10000; // 1229
    bool isP[n + 1] = {0};
    vector<int> primes;
    for (int i = 2; i < n + 1; ++i)
        isP[i] = 1;
    for (int i = 2; i  < n + 1; ++i)
    {
        if (isP[i])
            primes.push_back(i);
        for (int j = 0; j < primes.size() && i * primes[j] < n + 1; ++j)
        {
            isP[primes[j] * i] = 0;
            if (primes[j] % i == 0)
                break;
        }
    }
    cout << primes.size();
    return 0;
}